# Maintainer: Leonidas Spyropoulos <artafinde@archlinux.org>
# Contributor: Luca Weiss <luca (at) z3ntu (dot) xyz>

pkgname=lmdbxx
pkgver=1.0.0
pkgrel=2
pkgdesc="C++17 wrapper for the LMDB embedded B+ tree database library"
arch=('loong64' 'x86_64')
url="https://github.com/hoytech/lmdbxx"
license=('Unlicense')
depends=(lmdb)
source=("https://github.com/hoytech/lmdbxx/archive/$pkgver/lmdbxx-$pkgver.tar.gz")
sha512sums=('54f6c4863273b4de8aed6bc19f353c7a66d8ae633198e9784c55cea8e54460e4030ebe45e91a7c820aade084933f21cd4193ef8c04bb2aef11bf252281404171')
b2sums=('203173132a9c84c2d6a53799f8acc92dac5bd075b69f7b25e8eee3341933ccdd868eb190cef07371469856e32fc42215c5395db61f141863f60a5d0a2b888790')

check() {
  cd "${pkgname}-${pkgver}"
  make CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" check
}

package() {
  # Blocked from https://bugs.archlinux.org/task/77537
  # depends+=(
  #   lmdb liblmdb.so
  # )

  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" PREFIX=/usr install
  install -vDm 644 UNLICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}

# vim:set ft=sh sw=2 sts=2 et:
